package com.framework;


import com.ulisesbocchio.jasyptspringboot.environment.StandardEncryptableEnvironment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * @author zhangzhg
 */
@EnableAsync
@ConfigurationPropertiesScan
@EnableDiscoveryClient
@EnableFeignClients
@SpringBootApplication
@EnableCaching
public class BussApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder()
                .environment(new StandardEncryptableEnvironment())
                .sources(BussApplication.class).run(args);

        Environment environment = context.getBean(Environment.class);
        String port = environment.getProperty("local.server.port");
        Logger logger = LoggerFactory.getLogger(BussApplication.class );
        logger.info( "--------------- {} is success! port: {}---------------", BussApplication.class.getSimpleName(), port);

    }
}
